<html>
<head>
<title>StringAnalizer.java</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.ln { color: rgb(0,0,0); font-weight: normal; font-style: normal; }
.s0 { color: rgb(0,0,128); font-weight: bold; }
.s1 { }
.s2 { color: rgb(128,128,128); font-style: italic; }
.s3 { color: rgb(0,0,255); }
</style>
</head>
<BODY BGCOLOR="#ffffff">
<TABLE CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#C0C0C0" >
<TR><TD><CENTER>
<FONT FACE="Arial, Helvetica" COLOR="#000000">
StringAnalizer.java</FONT>
</center></TD></TR></TABLE>
<pre>

<a name="l1"><span class="s0">package </span><span class="s1">zadanie2; 
<a name="l2"> 
<a name="l3"></span><span class="s2">/** 
<a name="l4"> * Author: Daniel Michalski 
<a name="l5"> * Date: 28.02.13 
<a name="l6"> */</span><span class="s1"> 
<a name="l7"> 
<a name="l8"></span><span class="s0">public class </span><span class="s1">StringAnalizer { 
<a name="l9">    </span><span class="s0">private </span><span class="s1">String[] slowa; 
<a name="l10"> 
<a name="l11">    </span><span class="s0">public </span><span class="s1">StringAnalizer(String[] slowa){; 
<a name="l12">        </span><span class="s0">this</span><span class="s1">.slowa = slowa; 
<a name="l13">    } 
<a name="l14"> 
<a name="l15">    </span><span class="s0">public int </span><span class="s1">obliczDl(){ 
<a name="l16">        </span><span class="s0">int </span><span class="s1">dlugosc=</span><span class="s3">0</span><span class="s1">; 
<a name="l17"> 
<a name="l18">        </span><span class="s0">for</span><span class="s1">(</span><span class="s0">int </span><span class="s1">i=</span><span class="s3">0</span><span class="s1">; i&lt;slowa.length; i++) { 
<a name="l19">            dlugosc+=slowa[i].length(); 
<a name="l20">        } 
<a name="l21">          </span><span class="s0">return </span><span class="s1">dlugosc; 
<a name="l22">    } 
<a name="l23"> 
<a name="l24">    </span><span class="s0">public int </span><span class="s1">iloscSlowOpocz(String poczatek){ 
<a name="l25">        </span><span class="s0">int </span><span class="s1">iloscSlowOpocz = </span><span class="s3">0</span><span class="s1">; 
<a name="l26">        </span><span class="s0">for </span><span class="s1">(</span><span class="s0">int </span><span class="s1">i = </span><span class="s3">0</span><span class="s1">; i &lt; slowa.length; i++) { 
<a name="l27">            </span><span class="s0">if </span><span class="s1">(slowa[i].length() &lt; poczatek.length()) </span><span class="s0">continue</span><span class="s1">; 
<a name="l28">                String poczWyrazu = slowa[i].substring(</span><span class="s3">0</span><span class="s1">, poczatek.length()); 
<a name="l29">                </span><span class="s0">if</span><span class="s1">(poczWyrazu.equals(poczatek)) 
<a name="l30">                       iloscSlowOpocz++; 
<a name="l31">        } 
<a name="l32">        </span><span class="s0">return </span><span class="s1">iloscSlowOpocz; 
<a name="l33">    } 
<a name="l34">} 
<a name="l35"> 
<a name="l36"></span></pre>
</body>
</html>